namespace = cr_wol

# Six-month dispatcher. Randomness chooses the story, not whether active play works.
character_event = {
	id = cr_wol.1
	hide_window = yes
	is_triggered_only = yes
	trigger = {
		is_adult = yes
		OR = {
			has_focus = focus_rulership
			has_focus = focus_business
			has_focus = focus_seduction
			has_focus = focus_intrigue
			has_focus = focus_hunting
			has_focus = focus_war
			has_focus = focus_carousing
			has_focus = focus_family
			has_focus = focus_scholarship
			has_focus = focus_theology
		}
	}
	immediate = {
		random_list = {
			65 = { }
			35 = {
				if = { limit = { has_focus = focus_rulership } character_event = { id = cr_wol.2 } }
				else_if = { limit = { has_focus = focus_business } character_event = { id = cr_wol.3 } }
				else_if = { limit = { has_focus = focus_seduction } character_event = { id = cr_wol.4 } }
				else_if = { limit = { has_focus = focus_intrigue } character_event = { id = cr_wol.5 } }
				else_if = { limit = { has_focus = focus_hunting } character_event = { id = cr_wol.6 } }
				else_if = { limit = { has_focus = focus_war } character_event = { id = cr_wol.7 } }
				else_if = { limit = { has_focus = focus_carousing } character_event = { id = cr_wol.8 } }
				else_if = { limit = { has_focus = focus_family } character_event = { id = cr_wol.9 } }
				else_if = { limit = { has_focus = focus_scholarship } character_event = { id = cr_wol.10 } }
				else_if = { limit = { has_focus = focus_theology } character_event = { id = cr_wol.11 } }
			}
		}
	}
}

long_character_event = {
	id = cr_wol.2
	title = CR_WOL_AMBIENT_RULERSHIP_TITLE
	desc = CR_WOL_AMBIENT_RULERSHIP_DESC
	picture = GFX_cr_evt_council
	border = GFX_event_long_frame_economy
	is_triggered_only = yes
	option = {
		name = CR_WOL_AMBIENT_RULERSHIP_A
		cr_wol_roll_stewardship = yes
		if = { limit = { has_character_flag = cr_wol_action_succeeded } prestige = 15 }
		else = { prestige = -5 }
		cr_wol_progress_stewardship_education = yes
		cr_wol_progress_administrator = yes
		set_character_flag = cr_intimacy_context_rulership
		character_event = { id = cr_intimacy.1 }
		cr_wol_clear_roll = yes
	}
	option = {
		name = CR_WOL_AMBIENT_RULERSHIP_B
		cr_wol_roll_diplomacy = yes
		if = { limit = { has_character_flag = cr_wol_action_succeeded } piety = 10 }
		else = { prestige = -5 }
		cr_wol_progress_stewardship_education = yes
		cr_wol_progress_administrator = yes
		set_character_flag = cr_intimacy_context_rulership
		character_event = { id = cr_intimacy.1 }
		cr_wol_clear_roll = yes
	}
	option = {
		name = CR_WOL_AMBIENT_RULERSHIP_C
		wealth = -5
		cr_wol_progress_stewardship_education = yes
		cr_wol_progress_administrator = yes
		set_character_flag = cr_intimacy_context_rulership
		character_event = { id = cr_intimacy.1 }
	}
}

long_character_event = {
	id = cr_wol.3
	title = CR_WOL_AMBIENT_BUSINESS_TITLE
	desc = CR_WOL_AMBIENT_BUSINESS_DESC
	picture = GFX_cr_evt_market
	border = GFX_event_long_frame_economy
	is_triggered_only = yes
	option = {
		name = CR_WOL_AMBIENT_BUSINESS_A
		cr_wol_roll_stewardship = yes
		if = { limit = { has_character_flag = cr_wol_action_succeeded } wealth = 15 }
		else = { wealth = -10 }
		cr_wol_complete_business_architect = yes
		cr_wol_clear_roll = yes
	}
	option = {
		name = CR_WOL_AMBIENT_BUSINESS_B
		wealth = -5
		cr_wol_complete_business_gardener = yes
	}
	option = {
		name = CR_WOL_AMBIENT_BUSINESS_C
		cr_wol_roll_intrigue = yes
		if = { limit = { has_character_flag = cr_wol_action_succeeded } wealth = 25 }
		else = { prestige = -10 }
		cr_wol_complete_business_architect = yes
		cr_wol_clear_roll = yes
	}
}

long_character_event = {
	id = cr_wol.4
	title = CR_WOL_AMBIENT_SEDUCTION_TITLE
	desc = CR_WOL_AMBIENT_SEDUCTION_DESC
	picture = GFX_cr_evt_lovers
	border = GFX_event_long_frame_intrigue
	is_triggered_only = yes
	option = {
		name = CR_WOL_AMBIENT_SEDUCTION_A
		cr_wol_complete_seduction_mastery = yes
		set_character_flag = cr_intimacy_context_seduction
		character_event = { id = cr_intimacy.1 }
	}
	option = {
		name = CR_WOL_AMBIENT_SEDUCTION_B
		cr_wol_roll_diplomacy = yes
		if = { limit = { has_character_flag = cr_wol_action_failed } prestige = -5 }
		cr_wol_complete_seduction_mastery = yes
		set_character_flag = cr_intimacy_context_seduction
		character_event = { id = cr_intimacy.1 }
		cr_wol_clear_roll = yes
	}
	option = {
		name = CR_WOL_AMBIENT_SEDUCTION_C
		cr_wol_complete_seduction_pleasure = yes
		set_character_flag = cr_intimacy_context_seduction
		character_event = { id = cr_intimacy.1 }
	}
}

long_character_event = {
	id = cr_wol.5
	title = CR_WOL_AMBIENT_INTRIGUE_TITLE
	desc = CR_WOL_AMBIENT_INTRIGUE_DESC
	picture = GFX_cr_evt_spymaster
	border = GFX_event_long_frame_intrigue
	is_triggered_only = yes
	option = {
		name = CR_WOL_AMBIENT_INTRIGUE_A
		cr_wol_roll_intrigue = yes
		if = { limit = { has_character_flag = cr_wol_action_succeeded } prestige = 10 }
		else = { prestige = -5 }
		cr_wol_complete_intrigue_schemer = yes
		cr_wol_clear_roll = yes
	}
	option = {
		name = CR_WOL_AMBIENT_INTRIGUE_B
		wealth = -10
		cr_wol_complete_intrigue_schemer = yes
	}
	option = {
		name = CR_WOL_AMBIENT_INTRIGUE_C
		cr_wol_complete_intrigue_impaler = yes
	}
}

long_character_event = {
	id = cr_wol.6
	title = CR_WOL_AMBIENT_HUNTING_TITLE
	desc = CR_WOL_AMBIENT_HUNTING_DESC
	picture = GFX_cr_evt_hunt
	border = GFX_event_long_frame_war
	is_triggered_only = yes
	option = {
		name = CR_WOL_AMBIENT_HUNTING_A
		cr_wol_roll_martial = yes
		if = { limit = { has_character_flag = cr_wol_action_succeeded } prestige = 15 }
		else = { random_list = { 25 = { add_trait = wounded } 75 = { prestige = -5 } } }
		cr_wol_complete_hunting = yes
		cr_wol_clear_roll = yes
	}
	option = {
		name = CR_WOL_AMBIENT_HUNTING_B
		add_character_modifier = { name = cr_wol_hunting_vigor duration = 180 }
		cr_wol_complete_hunting = yes
	}
	option = {
		name = CR_WOL_AMBIENT_HUNTING_C
		wealth = -5
		cr_wol_complete_hunting = yes
	}
}

long_character_event = {
	id = cr_wol.7
	title = CR_WOL_AMBIENT_WAR_TITLE
	desc = CR_WOL_AMBIENT_WAR_DESC
	picture = GFX_cr_evt_battle
	border = GFX_event_long_frame_war
	is_triggered_only = yes
	option = {
		name = CR_WOL_AMBIENT_WAR_A
		cr_wol_roll_martial = yes
		if = { limit = { has_character_flag = cr_wol_action_succeeded } prestige = 15 }
		else = { prestige = -10 }
		cr_wol_complete_war_duelist = yes
		cr_wol_clear_roll = yes
	}
	option = {
		name = CR_WOL_AMBIENT_WAR_B
		cr_wol_roll_learning = yes
		if = { limit = { has_character_flag = cr_wol_action_succeeded } prestige = 15 }
		else = { prestige = -5 }
		cr_wol_complete_war_strategist = yes
		cr_wol_clear_roll = yes
	}
	option = {
		name = CR_WOL_AMBIENT_WAR_C
		add_character_modifier = { name = cr_wol_military_readiness duration = 180 }
		cr_wol_complete_war_strategist = yes
	}
}

long_character_event = {
	id = cr_wol.8
	title = CR_WOL_AMBIENT_CAROUSING_TITLE
	desc = CR_WOL_AMBIENT_CAROUSING_DESC
	picture = GFX_cr_evt_feast
	border = GFX_event_long_frame_diplomacy
	is_triggered_only = yes
	option = {
		name = CR_WOL_AMBIENT_CAROUSING_A
		cr_wol_complete_carousing_socializer = yes
	}
	option = {
		name = CR_WOL_AMBIENT_CAROUSING_B
		cr_wol_roll_intrigue = yes
		if = { limit = { has_character_flag = cr_wol_action_succeeded } wealth = 10 }
		else = { wealth = -10 }
		cr_wol_complete_carousing_gamer = yes
		cr_wol_clear_roll = yes
	}
	option = {
		name = CR_WOL_AMBIENT_CAROUSING_C
		cr_wol_complete_carousing_hedonist = yes
	}
}

long_character_event = {
	id = cr_wol.9
	title = CR_WOL_AMBIENT_FAMILY_TITLE
	desc = CR_WOL_AMBIENT_FAMILY_DESC
	picture = GFX_cr_evt_family
	border = GFX_event_long_frame_diplomacy
	is_triggered_only = yes
	option = {
		name = CR_WOL_AMBIENT_FAMILY_A
		cr_wol_complete_family_socializer = yes
	}
	option = {
		name = CR_WOL_AMBIENT_FAMILY_B
		cr_wol_complete_family_gamer = yes
	}
	option = {
		name = CR_WOL_AMBIENT_FAMILY_C
		wealth = -5
		add_character_modifier = { name = cr_wol_household_harmony duration = 180 }
		cr_wol_complete_family_socializer = yes
	}
}

long_character_event = {
	id = cr_wol.10
	title = CR_WOL_AMBIENT_SCHOLARSHIP_TITLE
	desc = CR_WOL_AMBIENT_SCHOLARSHIP_DESC
	picture = GFX_cr_evt_library
	border = GFX_event_long_frame_religion
	is_triggered_only = yes
	option = {
		name = CR_WOL_AMBIENT_SCHOLARSHIP_A
		cr_wol_complete_scholarship_scholar = yes
	}
	option = {
		name = CR_WOL_AMBIENT_SCHOLARSHIP_B
		wealth = -10
		cr_wol_complete_scholarship_scholar = yes
	}
	option = {
		name = CR_WOL_AMBIENT_SCHOLARSHIP_C
		cr_wol_complete_scholarship_mystic = yes
	}
}

long_character_event = {
	id = cr_wol.11
	title = CR_WOL_AMBIENT_THEOLOGY_TITLE
	desc = CR_WOL_AMBIENT_THEOLOGY_DESC
	picture = GFX_cr_evt_stone_church
	border = GFX_event_long_frame_religion
	is_triggered_only = yes
	option = {
		name = CR_WOL_AMBIENT_THEOLOGY_A
		piety = 10
		cr_wol_complete_theology = yes
	}
	option = {
		name = CR_WOL_AMBIENT_THEOLOGY_B
		cr_wol_roll_learning = yes
		if = { limit = { has_character_flag = cr_wol_action_succeeded } piety = 20 }
		else = { prestige = -5 }
		cr_wol_complete_theology = yes
		cr_wol_clear_roll = yes
	}
	option = {
		name = CR_WOL_AMBIENT_THEOLOGY_C
		trigger = { cr_wol_religion_supports_sacred_sex_trigger = yes }
		piety = 15
		cr_wol_complete_theology = yes
	}
}

long_character_event = {
	id = cr_wol.20
	title = CR_WOL_EDUCATION_IMPROVED_TITLE
	desc = { text = CR_WOL_EDUCATION_IMPROVED_DIPLOMACY trigger = { has_character_flag = cr_wol_education_improved_diplomacy } }
	desc = { text = CR_WOL_EDUCATION_IMPROVED_MARTIAL trigger = { has_character_flag = cr_wol_education_improved_martial } }
	desc = { text = CR_WOL_EDUCATION_IMPROVED_STEWARDSHIP trigger = { has_character_flag = cr_wol_education_improved_stewardship } }
	desc = { text = CR_WOL_EDUCATION_IMPROVED_INTRIGUE trigger = { has_character_flag = cr_wol_education_improved_intrigue } }
	desc = { text = CR_WOL_EDUCATION_IMPROVED_LEARNING trigger = { has_character_flag = cr_wol_education_improved_learning } }
	picture = GFX_cr_evt_library
	border = GFX_event_long_frame_religion
	is_triggered_only = yes
	option = { name = CR_WOL_EDUCATION_IMPROVED_A cr_wol_clear_education_award_flags = yes }
}

long_character_event = {
	id = cr_wol.21
	title = CR_WOL_LIFESTYLE_EARNED_TITLE
	desc = { text = CR_WOL_LIFESTYLE_ADMINISTRATOR trigger = { has_character_flag = cr_wol_earned_administrator } }
	desc = { text = CR_WOL_LIFESTYLE_ARCHITECT trigger = { has_character_flag = cr_wol_earned_architect } }
	desc = { text = CR_WOL_LIFESTYLE_GARDENER trigger = { has_character_flag = cr_wol_earned_gardener } }
	desc = { text = CR_WOL_LIFESTYLE_HEDONIST trigger = { has_character_flag = cr_wol_earned_hedonist } }
	desc = { text = CR_WOL_LIFESTYLE_SOCIALIZER trigger = { has_character_flag = cr_wol_earned_socializer } }
	desc = { text = CR_WOL_LIFESTYLE_GAMER trigger = { has_character_flag = cr_wol_earned_gamer } }
	desc = { text = CR_WOL_LIFESTYLE_SEDUCER trigger = { has_character_flag = cr_wol_earned_seducer } }
	desc = { text = CR_WOL_LIFESTYLE_SEDUCTRESS trigger = { has_character_flag = cr_wol_earned_seductress } }
	desc = { text = CR_WOL_LIFESTYLE_SCHEMER trigger = { has_character_flag = cr_wol_earned_schemer } }
	desc = { text = CR_WOL_LIFESTYLE_IMPALER trigger = { has_character_flag = cr_wol_earned_impaler } }
	desc = { text = CR_WOL_LIFESTYLE_HUNTER trigger = { has_character_flag = cr_wol_earned_hunter } }
	desc = { text = CR_WOL_LIFESTYLE_DUELIST trigger = { has_character_flag = cr_wol_earned_duelist } }
	desc = { text = CR_WOL_LIFESTYLE_STRATEGIST trigger = { has_character_flag = cr_wol_earned_strategist } }
	desc = { text = CR_WOL_LIFESTYLE_SCHOLAR trigger = { has_character_flag = cr_wol_earned_scholar } }
	desc = { text = CR_WOL_LIFESTYLE_MYSTIC trigger = { has_character_flag = cr_wol_earned_mystic } }
	desc = { text = CR_WOL_LIFESTYLE_THEOLOGIAN trigger = { has_character_flag = cr_wol_earned_theologian } }
	picture = GFX_cr_evt_courtiers_talking
	border = GFX_event_long_frame_diplomacy
	is_triggered_only = yes
	option = { name = CR_WOL_LIFESTYLE_EARNED_A cr_wol_clear_lifestyle_award_flags = yes }
}

character_event = { id = cr_wol.40 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_hold_court_cooldown } }
character_event = { id = cr_wol.41 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_venture_cooldown } }
character_event = { id = cr_wol.42 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_hunt_cooldown } }
character_event = { id = cr_wol.43 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_maneuvers_cooldown } }
character_event = { id = cr_wol.44 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_revel_cooldown } }
character_event = { id = cr_wol.45 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_family_cooldown } }
character_event = { id = cr_wol.46 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_study_cooldown } }
character_event = { id = cr_wol.47 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_theology_cooldown } }
character_event = { id = cr_wol.48 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_seduction_cooldown } }
character_event = { id = cr_wol.49 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_spy_cooldown } }
character_event = { id = cr_wol.50 hide_window = yes is_triggered_only = yes immediate = { clr_character_flag = cr_wol_party_invite_cooldown } }
